import request from "@/utils/request";

// 查询客户信息列表
export function listCustom(query) {
  return request({
    url: "/mes/custom/list",
    method: "get",
    params: query,
  });
}

// 查询客户信息详细
export function getCustom(id) {
  return request({
    url: "/mes/custom/" + id,
    method: "get",
  });
}

// 新增客户信息
export function addCustom(data) {
  return request({
    url: "/mes/custom",
    method: "post",
    data: data,
  });
}

// 修改客户信息
export function updateCustom(data) {
  return request({
    url: "/mes/custom",
    method: "put",
    data: data,
  });
}

// 删除客户信息
export function delCustom(id) {
  return request({
    url: "/mes/custom/" + id,
    method: "delete",
  });
}
// 客户信息状态修改
export function changeMesCustomStatus(id, status) {
  const data = {
    id,
    status,
  };
  return request({
    url: "/mes/custom/changeStatus",
    method: "put",
    data: data,
  });
}

// 导出
export const customerExport = (data) => {
  return request({
    url: "mes/custom/export",
    method: "post",
    data,
    responseType: "blob",
  });
};
// 下载模板
export const customerTemplate = (data) => {
  return request({
    url: "mes/custom/importTemplate",
    method: "post",
    data,
    responseType: "blob",
  });
};
